from pymysql import Connection

conn = Connection(
    host="localhost",
    port=3306,
    user="root",
    password=""
)

cursor = conn.cursor()

conn.select_db("test")

cursor.execute("select * from student")

students = cursor.fetchall()

print(students)

conn.commit()

conn.close()